/*
 * @Author: ZAL 2177624751@qq.com
 * @Date: 2025-03-30 11:42:46
 * @LastEditors: ZAL 2177624751@qq.com
 * @LastEditTime: 2025-03-30 12:51:55
 * @FilePath: \shop_app_vue3d:\Users\21776\Desktop\毕设\fruit_backded\src\main\java\com\fruitshop\controller\TestController.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package com.fruitshop.controller;

import com.fruitshop.vo.ResultVO;
import com.fruitshop.vo.UserInfoVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试控制器
 */
@RestController
public class TestController {

    /**
     * 测试接口
     */
    @GetMapping("/test")
    public String test() {
        return "API正常工作";
    }

    @PostMapping("/test-login")
    public ResultVO<UserInfoVO> testLogin() {
        UserInfoVO userInfo = new UserInfoVO();
        userInfo.setId(1L);
        userInfo.setNickname("测试用户");
        userInfo.setToken("test_token_" + System.currentTimeMillis());
        return ResultVO.success(userInfo);
    }
} 